package com.googlecode.gmf.data

class WebLinksTest extends GroovyTestCase {
	void testASimpleAssociationOfNodes() {
		Web web = Web.getAnEmptyWeb();
		Node n1 = new Node(title: "Node One", content: "Content One")
		Node n2 = new Node(title: "Node Two", content: "Content Two")
		web.addNode(n1)
		web.addNode(n2)
		web.link(n1, n2)
		
		assertFalse("List of linked nodes should not be empty", web.linksFrom(n1).isEmpty())
		assertEquals("List should contain just one entry", 1, web.linksFrom(n1).size())
		assertEquals("List entry should be Node Two", n2, web.linksFrom(n1).get(0))
	}
}